Skip to contentSkip to conversation

Change in openvpn[master]: Fix some msg() calls with wrong number of arguments in Windows-only code

Openvpn-devel In review flichtenheld (Code Review) 2 participants 6 messages May 8 – May 11 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1778239616000.Ia688ec12e642de699811ced8668b40be9fbb6155@...2715...

#1 lore raw

Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1672?usp=email

to review the following change.

Change subject: Fix some msg() calls with wrong number of arguments in Windows-only code
......................................................................

Fix some msg() calls with wrong number of arguments in Windows-only code

For some reason neither MSVC nor MinGW complained? cppcheck did (once told that msg is a printf-style function).

Change-Id Ia688ec12e642de699811ced8668b40be9fbb6155

---
M src/openvpnmsica/msiex.c
M src/tapctl/tap.c

2 files changed, 3 insertions(+), 3 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/72/1672/1

src/openvpnmsica/msiex.c +1 -1
index f8bf6ae..4d48f06 100644
@@ -51,7 +51,7 @@
         *pszValue = (LPWSTR)malloc(++dwLength * sizeof(WCHAR));
         if (*pszValue == NULL)
         {
-            msg(M_FATAL, "%s: malloc(%u) failed", dwLength * sizeof(WCHAR));
+            msg(M_FATAL, "%s: malloc(%u) failed", __FUNCTION__, dwLength * sizeof(WCHAR));
             return ERROR_OUTOFMEMORY;
         }
 
src/tapctl/tap.c +2 -2
index 6ed395d..cccc0e1 100644
@@ -487,8 +487,8 @@
         }
 
         default:
-            msg(M_NONFATAL, "%s: \"%ls\" registry value is not string (type %u)", __FUNCTION__,
-                dwValueType);
+            msg(M_NONFATAL, "%s: \"%ls\" registry value is not string (type %u)",
+                __FUNCTION__, szName, dwValueType);
             return ERROR_UNSUPPORTED_TYPE;
     }
 }

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1672?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia688ec12e642de699811ced8668b40be9fbb6155
Gerrit-Change-Number: 1672
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

cron2 has posted comments on this change by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1672?usp=email )

Change subject: Fix some msg() calls with wrong number of arguments in Windows-only code
......................................................................

Patch Set 1: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1672?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia688ec12e642de699811ced8668b40be9fbb6155
Gerrit-Change-Number: 1672
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Fri, 08 May 2026 15:30:38 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

#3 lore raw

PATCH 1/1 Fix some msg() calls with wrong number of arguments in Windows-only code

In reply to a message not in the archive

From: Frank Lichtenheld <[email protected]...>

For some reason neither MSVC nor MinGW complained? cppcheck did (once told that msg is a printf-style function).

Change-Id Ia688ec12e642de699811ced8668b40be9fbb6155

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1672
---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1672
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>

src/openvpnmsica/msiex.c +1 -1
index f8bf6ae..4d48f06 100644
@@ -51,7 +51,7 @@
         *pszValue = (LPWSTR)malloc(++dwLength * sizeof(WCHAR));
         if (*pszValue == NULL)
         {
-            msg(M_FATAL, "%s: malloc(%u) failed", dwLength * sizeof(WCHAR));
+            msg(M_FATAL, "%s: malloc(%u) failed", __FUNCTION__, dwLength * sizeof(WCHAR));
             return ERROR_OUTOFMEMORY;
         }
 
src/tapctl/tap.c +2 -2
index 6ed395d..cccc0e1 100644
@@ -487,8 +487,8 @@
         }
 
         default:
-            msg(M_NONFATAL, "%s: \"%ls\" registry value is not string (type %u)", __FUNCTION__,
-                dwValueType);
+            msg(M_NONFATAL, "%s: \"%ls\" registry value is not string (type %u)",
+                __FUNCTION__, szName, dwValueType);
             return ERROR_UNSUPPORTED_TYPE;
     }
 }
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: Fix some msg() calls with wrong number of arguments in Windows-only code

Impressive find. Bug :-) - have not tried to figure out how to get these messages printed (it's in the error handlers, so quite likely "never, for most users"). Still, obviously correct fix.

Test compiled on mingw/ubuntu.

Your patch has been applied to the master and release/2.7 branch (bug).

commit af44c0f8929bc9817a11ac149ae01f3589959325 (master) commit 815a3bd87d61b57d640551386efce9638aa014a0 (release/2.7)

Author: Frank Lichtenheld
Date:   Fri May 8 17:31:02 2026 +0200
     Fix some msg() calls with wrong number of arguments in Windows-only code

     Signed-off-by: Frank Lichtenheld <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1672
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg36862.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#2) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1672?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by cron2

Change subject: Fix some msg() calls with wrong number of arguments in Windows-only code
......................................................................

Fix some msg() calls with wrong number of arguments in Windows-only code

For some reason neither MSVC nor MinGW complained? cppcheck did (once told that msg is a printf-style function).

Change-Id Ia688ec12e642de699811ced8668b40be9fbb6155

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1672
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg36862.html

---
M src/openvpnmsica/msiex.c
M src/tapctl/tap.c

2 files changed, 3 insertions(+), 3 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/72/1672/2

src/openvpnmsica/msiex.c +1 -1
index f8bf6ae..4d48f06 100644
@@ -51,7 +51,7 @@
         *pszValue = (LPWSTR)malloc(++dwLength * sizeof(WCHAR));
         if (*pszValue == NULL)
         {
-            msg(M_FATAL, "%s: malloc(%u) failed", dwLength * sizeof(WCHAR));
+            msg(M_FATAL, "%s: malloc(%u) failed", __FUNCTION__, dwLength * sizeof(WCHAR));
             return ERROR_OUTOFMEMORY;
         }
 
src/tapctl/tap.c +2 -2
index 16e3c0b..1d94988 100644
@@ -487,8 +487,8 @@
         }
 
         default:
-            msg(M_NONFATAL, "%s: \"%ls\" registry value is not string (type %u)", __FUNCTION__,
-                dwValueType);
+            msg(M_NONFATAL, "%s: \"%ls\" registry value is not string (type %u)",
+                __FUNCTION__, szName, dwValueType);
             return ERROR_UNSUPPORTED_TYPE;
     }
 }

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1672?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia688ec12e642de699811ced8668b40be9fbb6155
Gerrit-Change-Number: 1672
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>

#6 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1672?usp=email )

Change subject: Fix some msg() calls with wrong number of arguments in Windows-only code
......................................................................

Fix some msg() calls with wrong number of arguments in Windows-only code

For some reason neither MSVC nor MinGW complained? cppcheck did (once told that msg is a printf-style function).

Change-Id Ia688ec12e642de699811ced8668b40be9fbb6155

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1672
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg36862.html

---
M src/openvpnmsica/msiex.c
M src/tapctl/tap.c

2 files changed, 3 insertions(+), 3 deletions(-)
src/openvpnmsica/msiex.c +1 -1
index f8bf6ae..4d48f06 100644
@@ -51,7 +51,7 @@
         *pszValue = (LPWSTR)malloc(++dwLength * sizeof(WCHAR));
         if (*pszValue == NULL)
         {
-            msg(M_FATAL, "%s: malloc(%u) failed", dwLength * sizeof(WCHAR));
+            msg(M_FATAL, "%s: malloc(%u) failed", __FUNCTION__, dwLength * sizeof(WCHAR));
             return ERROR_OUTOFMEMORY;
         }
 
src/tapctl/tap.c +2 -2
index 16e3c0b..1d94988 100644
@@ -487,8 +487,8 @@
         }
 
         default:
-            msg(M_NONFATAL, "%s: \"%ls\" registry value is not string (type %u)", __FUNCTION__,
-                dwValueType);
+            msg(M_NONFATAL, "%s: \"%ls\" registry value is not string (type %u)",
+                __FUNCTION__, szName, dwValueType);
             return ERROR_UNSUPPORTED_TYPE;
     }
 }

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1672?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia688ec12e642de699811ced8668b40be9fbb6155
Gerrit-Change-Number: 1672
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>